package com.example.newsSys.domain;

import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;


public class News implements Serializable {
    private int id;
    // 在反序列化时有作用
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date newsDate;
    private String newsName;
    private String layoutName;
    private String newsAuthor;
    private String newsTitle;
    private String newsInfo;
    private String newsContent;

    public News() {
    }

    public News(Date newsDate, String newsName, String layoutName, String newsAuthor, String newsTitle, String newsInfo, String newsContent) {
        this.newsDate = newsDate;
        this.newsName = newsName;
        this.layoutName = layoutName;
        this.newsAuthor = newsAuthor;
        this.newsTitle = newsTitle;
        this.newsInfo = newsInfo;
        this.newsContent = newsContent;
    }

    public News(int id, java.sql.Date newsDate, String newsName, String layoutName, String newsAuthor, String newsTitle, String newsInfo, String newsContent) {
        this.id = id;
        this.newsDate = newsDate;
        this.newsName = newsName;
        this.layoutName = layoutName;
        this.newsAuthor = newsAuthor;
        this.newsTitle = newsTitle;
        this.newsInfo = newsInfo;
        this.newsContent = newsContent;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Date getNewsDate() {
        return newsDate;
    }

    public void setNewsDate(Date newsDate) {
        this.newsDate = newsDate;
    }

    public String getNewsName() {
        return newsName;
    }

    public void setNewsName(String newsName) {
        this.newsName = newsName;
    }

    public String getLayoutName() {
        return layoutName;
    }

    public void setLayoutName(String layoutName) {
        this.layoutName = layoutName;
    }

    public String getNewsAuthor() {
        return newsAuthor;
    }

    public void setNewsAuthor(String newsAuthor) {
        this.newsAuthor = newsAuthor;
    }

    public String getNewsTitle() {
        return newsTitle;
    }

    public void setNewsTitle(String newsTitle) {
        this.newsTitle = newsTitle;
    }

    public String getNewsInfo() {
        return newsInfo;
    }

    public void setNewsInfo(String newsInfo) {
        this.newsInfo = newsInfo;
    }

    public String getNewsContent() {
        return newsContent;
    }

    public void setNewsContent(String newsContent) {
        this.newsContent = newsContent;
    }

    @Override
    public String toString() {
        return "News{" +
                "id=" + id +
                ", newsDate=" + newsDate +
                ", newsName='" + newsName + '\'' +
                ", layoutName='" + layoutName + '\'' +
                ", newsAuthor='" + newsAuthor + '\'' +
                ", newsTitle='" + newsTitle + '\'' +
                ", newsInfo='" + newsInfo + '\'' +
                ", newsContent='" + newsContent + '\'' +
                '}';
    }
}
